{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7cf1c50f",
   "metadata": {},
   "source": [
    "# tf.keras.input\n",
    "\n",
    "模型输入定义\n",
    "\n",
    "tf = 2.9.1\n",
    "\n",
    "```python\n",
    "tf.keras.layers.Input(\n",
    "    shape=None,\n",
    "    batch_size=None,\n",
    "    name=None,\n",
    "    dtype=None,\n",
    "    sparse=None,\n",
    "    tensor=None,\n",
    "    ragged=None,\n",
    "    type_spec=None,\n",
    "    **kwargs,\n",
    ")\n",
    "\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "b76e743b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.9.1'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "\n",
    "tf.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e8699174",
   "metadata": {},
   "source": [
    "## 例子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "48c25d10",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = tf.keras.layers.Input(shape=(32,))\n",
    "y = tf.keras.layers.Dense(units=16, activation='softmax')(x)\n",
    "\n",
    "model = tf.keras.models.Model(inputs=x, outputs=y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "c8605a46",
   "metadata": {},
   "outputs": [],
   "source": [
    "tf.keras.layers.Input?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7611c7ed",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0727bb87",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
